<template>
  <div class="adminMain">
    <div class="left">
      <el-col :span="12" style="width: 100%">
        <el-menu default-active="2" class="el-menu-vertical-demo">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-user-solid"></i>
              <span>用户管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="1-1" @click="toStudentManage"
                >学生</el-menu-item
              >
              <el-menu-item index="1-2" @click="toTeacherManage"
                >教师</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-collection"></i>
              <span>帖子管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="2-1" @click="toPost1Manage"
                >话题广场</el-menu-item
              >
              <el-menu-item index="2-2" @click="toPost2Manage"
                >教师资源分享</el-menu-item
              >
              <el-menu-item index="2-3" @click="toPost3Manage"
                >新生可了解</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-s-comment"></i>
              <span>评论管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="3-1" @click="toCommentManage"
                >所有评论</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-warning"></i>
              <span>举报管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="4-1" @click="toTipOffPostManager"
                >帖子</el-menu-item
              >
              <el-menu-item index="4-2" @click="toTipOffCommentManager"
                >评论</el-menu-item
              >
              <el-menu-item index="4-3" @click="toTipOffUserManager"
                >用户</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-col>
    </div>
    <div class="right">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    toStudentManage() {
      this.$router.push({
        path: "/admin/student",
      });
    },
    toTeacherManage() {
      this.$router.push({
        path: "/admin/teacher",
      });
    },
    toPost1Manage() {
      this.$router.push({
        path: "/admin/post1",
      });
    },
    toPost2Manage() {
      this.$router.push({
        path: "/admin/post2",
      });
    },
    toPost3Manage() {
      this.$router.push({
        path: "/admin/post3",
      });
    },
    toTipOffPostManager() {},
    toCommentManage() {
      this.$router.push({
        path: "/admin/comment",
      });
    },
    toTipOffPostManager() {
      this.$router.push({
        path: "/admin/tipoff/post",
      });
    },
    toTipOffCommentManager() {
      this.$router.push({
        path: "/admin/tipoff/comment",
      });
    },
    toTipOffUserManager() {
      this.$router.push({
        path: "/admin/tipoff/user",
      });
    },
  },
};
</script>

<style scoped>
.adminMain {
  width: 100%;
  padding-top: 20px;
  /* height: 700px; */
  /* background-color: #fff; */
}
.left {
  float: left;
  width: 15%;
  height: 700px;
  margin-left: 20px;
  background-color: #fff;
}
.right {
  float: right;
  width: 81%;
  height: 700px;
  margin-right: 25px;
  background-color: white;
}
</style>
